import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import config from "@/common/config";
import utils from "@/common/utils";
import http from "@/common/http";

import "./common/axios";

import ElementPlus from "element-plus";
import locale from 'element-plus/es/locale/lang/zh-cn';
import 'element-plus/dist/index.css';
import 'dayjs/locale/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const app = createApp(App)
  .use(store)
  .use(router)
  .use(ElementPlus, { locale })

app.config.globalProperties.$config = config;
app.config.globalProperties.$utils = utils;
app.config.globalProperties.$http = http;

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount("#app");

export { app };
